//统一管理相关的接口
import request from "@/utils/request";

//统一管理接口
enum API {
    BIG_EVENTS_URL = "/itp/api/bigEvents/data",
    //大事件接口
    OPERATOR_BIG_EVENTS_URL = "/itp/api/bigEvents",
    //大事件类型
    BIG_EVENTS_TYPE_URL = "/itp/api/bigEvents/config",
    
}


//暴露请求函数
//获取事件类型数据
export const reqGetBigEventsType = () => request.get(API.BIG_EVENTS_TYPE_URL);
//新增大事件类型
export const addBigEventsType = (data: { typeCode: any; typeName: any; typeColor: any; }[]) => request.post(API.BIG_EVENTS_TYPE_URL,data);
//修改大事件类型
export const editBigEventsType = (data: { id: any; typeCode: any; typeName: any; typeColor: any; }[]) => request.put(API.BIG_EVENTS_TYPE_URL,data);
//删除大事件类型
export const deleteBigEventsType = (data: any[]) => request.delete(API.BIG_EVENTS_TYPE_URL,{data:data});

//获取10年国债估值曲线和大事件数据
export const reqGetBigEvents = (data: { startDate: string; endDate: string; eventConfigIds: number[] | null; eventsWght: string | null; eventsContent: string | null; }) => request.post(API.BIG_EVENTS_URL,data);
//新增大事件
export const addBigEvents = (data: { occurStartDateStr: string; occurEndDateStr: string; forEventsConfigId: string; eventsCont: string; eventsWght: number; }) => request.post(API.OPERATOR_BIG_EVENTS_URL,data);
//修改大事件
export const editBigEvents = (data: { occurStartDateStr: string; occurEndDateStr: string; forEventsConfigId: string; eventsCont: string; eventsWght: number; id: string; }[]) => request.put(API.OPERATOR_BIG_EVENTS_URL,data);
//删除大事件
export const deleteBigEvents = (data: any[]) => request.delete(API.OPERATOR_BIG_EVENTS_URL,{data:data});